<!doctype html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>jQuery.Calendar</title>
        <link rel="stylesheet" href="css/src.css">
        <script src="src/lib/jquery.js"></script>
        <script src="src/lib/underscore.js"></script>
        <script src="lang/lang.es.js"></script>
    </head>
    <body>
        <div id="calendar">
        </div>
        <script src="src/src.js"></script>
        <script id="calendar-scaffold" type="text/template">
            <table class="jquery-calendar-table">
                <thead>
                    <tr>
                        <th colspan="7">
                            <span id="first-month">&#124;&lt;&lt;</span>
                            <span id="less-month">&lt;</span>
                            <%= CURRENT_DATE %>
                            <span id="more-month">&gt;</span>
                            <span id="last-month">&gt;&gt;&#124;</span>
                        </th>
                    </tr>
                    <tr>
                        <th><%= SUNDAY %></th>
                        <th><%= MONDAY %></th>
                        <th><%= TUESDAY %></th>
                        <th><%= WEDNESDAY %></th>
                        <th><%= THURSDAY %></th>
                        <th><%= FRIDAY %></th>
                        <th><%= SATURDAY %></th>
                    </tr>
                </thead>
                <tbody>
                </tbody>
            </table>
        </script>
        <script id="calendar-days" type="text/template">
            <tr>
                <td class="center"><%= DAY_0 %></td>
                <td class="center"><%= DAY_1 %></td>
                <td class="center"><%= DAY_2 %></td>
                <td class="center"><%= DAY_3 %></td>
                <td class="center"><%= DAY_4 %></td>
                <td class="center"><%= DAY_5 %></td>
                <td class="center"><%= DAY_6 %></td>
            </tr>           
        </script>
        <script>
            (function (){
                var el = $('html');
                if (false === jQuery.calendar.debug) {
                    // Remove the debug version
                    el.find('script[src="src/src.js"]').remove();

                    // Add the minified script
                    document.body.appendChild(document.createElement('script')).src="min.js";

                    // Add the minified css
                    el.find('link[href="css/src.css"][rel="stylesheet"]').attr('href', 'min.css');
                }
                el.find('#calendar').calendar({
                    templates: {
                        scaffold: $('#calendar-scaffold').html(),
                        days: $('#calendar-days').html()
                    }
                });
            }());
        </script>
    </body>
</html>
